FILE(GLOB UNITTEST_SOURCE_FILES *.cpp)
FILE(GLOB UNITTEST_HEADER_FILES *.h)

INCLUDE(FindCppUnit.cmake)

INCLUDE_DIRECTORIES(${CPPUNIT_INCLUDE_DIR})

ADD_EXECUTABLE(TexGenUnitTests ${UNITTEST_SOURCE_FILES} ${UNITTEST_HEADER_FILES})

TARGET_LINK_LIBRARIES(TexGenUnitTests TexGenCore)

IF(CPPUNIT_LIBRARIES)
	TARGET_LINK_LIBRARIES(TexGenUnitTests optimized ${CPPUNIT_LIBRARIES})
ENDIF(CPPUNIT_LIBRARIES)

IF(CPPUNIT_DEBUG_LIBRARIES)
	TARGET_LINK_LIBRARIES(TexGenUnitTests debug ${CPPUNIT_DEBUG_LIBRARIES})
ENDIF(CPPUNIT_DEBUG_LIBRARIES)

#IF(WIN32)
#	ADD_CUSTOM_COMMAND(TARGET TexGenUnitTests POST_BUILD COMMAND $(TargetPath) WORKING_DIRECTORY $(TargetDir))
#ENDIF(WIN32)

